package org.witsoft.localmq.impl;

import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import org.witsoft.localmq.MessageBroker;
import org.witsoft.localmq.MessageManager;
import org.witsoft.localmq.OffsetManager;
import org.witsoft.localmq.StatsService;

/**
 * @ClassName: StatsServiceImpl
 * @Description:
 * @Author: Colin
 * @Date: 2020/12/27 12:20 PM
 * @Version 1.0
 **/
@RequiredArgsConstructor
public class StatsServiceImpl implements StatsService{

    @NonNull
    private MessageBroker messageBroker;

    @NonNull
    private OffsetManager offsetManager;

    @Override
    public int getBrokerQueueSize() {
        return messageBroker.getQueueSize();
    }

    @Override
    public long getBrokerQueueDataSize() {
        return messageBroker.getQueueDataSize();
    }

    @Override
    public long getProduceOffset() {
        return offsetManager.getProduceOffset();
    }

    @Override
    public long getConsumeOffset() {
        return offsetManager.getConsumeOffset();
    }
}
